/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.wider.foundation.concurrency;

/**
 * This interface defines a standard framework for implementing Runnable that able to be stopped by the user
 * @author William Choi <avextk@gmail.com>
 */
public interface Stoppable {
    /**
     * Method for user to explicity start the instance of the implementation.
     * @return  True if succeeded; false otherwise.
     */
    public boolean start();

    /**
     * Method for user to stop the alive instance of the implementation.
     * @return  True if succeeded; false otherwise.
     */
    public boolean stop();

    /**
     * Check if the instance has been started.
     * @return  True if so; false otherwise.
     */
    public boolean isStarted();

    /**
     * Check if the instance has been stopped.
     * @return  True if so; false otherwise.
     */
    public boolean isStopped();
}
